<template>
  <div
    :id="props.id"
    :class="props.required ? 'contact' : 'bg'"
    :style="{ width: props.width, padding: props.padding }"
  >
    <TitleItem :required="true" :title="props.title"></TitleItem>
    <slot>
      <MyEnlargePic :list="aboutList"></MyEnlargePic>
    </slot>
  </div>
</template>

<script setup>
const props = defineProps({
  required: {
    type: Boolean,
    required: false,
  },
  width: {
    type: String,
    default: "",
  },
  padding: {
    type: String,
    default: "",
  },
  title: {
    type: String,
    default: "",
  },
  id: {
    type: String,
    default: "",
  },
  list: {
    type: Array,
    default: [],
  },
});
// 相关形象
const aboutList = ref([
  {
    name: "相关形象1",
    url: "/_nuxt/assets/images/400x400.png",
  },
  {
    name: "wow",
    url: "/_nuxt/assets/images/01.png",
  },
  {
    name: "相关形象3",
    url: "/_nuxt/assets/images/phone.png",
  },
  {
    name: "相关形象4",
    url: "/_nuxt/assets/images/03.png",
  },
]);
</script>

<style scoped lang="scss">
.bg {
  background-color: #fff;
}
.contact {
  background-color: #fff;
  padding: 40px;
  transition: all 0.5s ease-in-out;
}
.contact:hover {
  /* x 偏移量 | y 偏移量 | 阴影模糊半径 | 阴影扩散半径 | 阴影颜色 */
  box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}
.pics {
  width: 100%;
  overflow-x: auto;
  white-space: nowrap; /* 防止子元素换行 */
  margin-top: 30px;
  .pic {
    display: inline-block;
    margin-left: 20px;
    .img {
      position: relative;
      width: 290px;
      height: 290px;
      background: linear-gradient(to top, #fff, #f2f4f8);

      border-radius: 5px;
      white-space: nowrap;
      display: flex;
      justify-content: center;
      align-items: center;
      > img {
        width: 160px;
        height: 226px;
        //object-fit: cover;
      }
      .bigscale {
        position: absolute;
        right: 16px;
        bottom: 30px;
        width: 24px;
        height: 24px;
        background: url("@/assets/images/bigscale.png") no-repeat;
      }
    }

    .text {
      font-size: 16px;
      text-align: center;
      color: #222;
      margin-top: 20px;
    }
  }
  .pic:first-child {
    margin-left: 0;
  }
}
</style>
